package cn.mandifal.pay.service.impl;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016102400753986";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQClTRsDdNpztz6LVsGO9Mnh293S/opymNGv3LeSxcQ+ji0LyKGcYBfczoWIKHhS+mXKEfXhRNmGzOZxOwPQWWBiEAkcJyQiTx3i2YjZfF9ZEJHjD+VJCw/0gh9oZVTZbGUYRBbwdaJJ5KzR1AwnjyLSJ1OwRlLWBMPT6eO8xFtygbld+G9pAA7KX6wyShS4JJVQv7LvB4hQA0DoSvoAaJ79UT2z6lkj5svskRQ9HfxW95NJb8S+oAJ9j5vKbg9LtlLISyLlAMeHewZEKQSUjGJi9P/sCDJ+7qisdryCfvYp4jpitVJ3xkB40LonThPAV5ATHPju+DdQVNxS/WIH7darAgMBAAECggEAIQTU54zY8hJhcO3kfgzRoscLeVEVEK0L/agGF1Bf0esOfnMWLSlYuueZ7se+uTyBRqrtxZC+LtoREf8q1Nx1j0EKwM/kvOG245B2cJMSbLUNnyCWuU93YWz4nx7WoxOu4fj/6ApnX4FJMCS+RMyntPjcE7MIau3KvDLVJejHJ4kFYD9egwjNv9Zewiz8nTz/0WtiU56DF7ykMOvTGdJoehv6qyASgmP35tITUo2f2EHQAxK+R/P/rSv4JcSmLCozmUa1lmtd6Qk1+e64z6nPgGQsUOYqQHaHvChPUO7XaX8cymC3k2MpB2aJ168Fx4CEzy6gaxlt1ZlPIluqZfx6cQKBgQDnamxurSDN6Ke6372Mkzx4Ru1NLKlOcWw04f0P35pubQfXa/n3g3Kq8ULRfyQFA6hhOw7FZixB3Cs6194mohmIDLwfyvq0taeLV3fIxvYT4IxW/kKV5rl7IXKnDi+Wr+uX1wcIz/gBHIFYB7781iImG7hlfVx8WTBoztd4F7h9qQKBgQC23KIG586Tr7aF5NQW1e4OoyvoWavn42fmd5uvoA/o3QNlPhaPiKo2ojYvaLdBOkj9v2Y7OusCN0qUMBZkgrqeWiCk3I/axBOGIIUkIiv2CWgALwTZ2XLpFerPFtUCCLUtZing/irkl8ldgPyXPzDP9ChfZIJZRBcUnslX3bseMwKBgDNnwpp7PtQ+oDO0y8hUVJRrPP9tslZIf77njG1gQE/TTHCf/bDrtCcg3LToxzmN7HNcyRU0cxRWMgwqM6DlVUKRgaCWWEaYK5WaYnNpLvSPZt1UMbpWvFELxwow7oVMosrh6yAcAn1Mtba2UcicUI2ijr2MsWS18zj06Yw1yLexAoGANAmRalmpJcoJLQ0zddQnTK8Ona53ByRluuYqvc3U+TV78+G5VdtUZPvAY7lu/PbzMpK3Kv/XROgrJwSQOsYhCVMomwHRRjYqQC8c9G1tCTUgDX1T6hLBaqc8DPa4Yz3LIUJDhK2P00GGoj9Eol3vLB6VJqBZn8GKt+l/7qtAxpUCgYEA2lQCcNolc7YjDKAv1JXi2MP1ufvlVHzMpVO2iU20lXpJCRbxhweqe5N6eVFPnusrnBe+WGI6Gg+e4IsBmryh/pB0+uzr+iJHX8z4QFiflbvurNHM0PVuClUAe1+Mp5d46FpfBvO0AcvnTWVmZV3SPGm+Sj4+HpxAQqySmVUXNXw=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmzjoisK5+kXrQVamZtI08jCWsCMrw7G1IjzNUSp+jRGbLJXykLLsdGELYda6LYCX+qqIeT7LAconGPjJBkvV1OZeypz4Jie7zxwx12rhZK8/8+rlNEUTcl61WX/5X1rkrOETMaYtd71OxXuQPskERUe9KjXgiqcGtmDLX5DQk2L8KTusL6QyqnB6wIGzKunpYrehkwA4VdK9Ynho+SWiKew96nBm72YLTfmnV27fpKh7lgHJPV91MVtWKBB9SKY6Wy42FDMMBA7YjNAHmCVUvynoXKAXvWdQR1zo5LFVSYc5EAs1xYEBs1l/Ui2cEQQWOXxKgvYppiiB99IGG+wVlwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://3057tw8230.wicp.vip/zhiFuBaoPayController/notifyUrl.do";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://3057tw8230.wicp.vip/zhiFuBaoPayController/returnUrl.do";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

